<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js">
        
    </script>
</head>
<body>
    <!-- 
        过滤器可以对 插值的数据进行二次处理在显示出来
        但是在vue3被删除了 因为计算属性也能实现
    -->
    <div id="app">
       <div>
        {{data | formData}}
       </div>
    </div>
   
</body>
<script>
    let vm = new Vue({
        el:"#app",
        data:{
            // data:1672531200000,
            data:1619990400000
        },
        filters:{
            formData(value){
                let v = new Date(value)
                let y = v.getFullYear()
                let aa = v.getMonth()+1
                let m = aa<10? "0"+aa :aa
                let bb = v.getDate()
                let d = bb<10? "0"+bb :bb
                console.log(y,'y',m,'m',d,'d')
                return y+'年'+m+"月"+d+"日"
            }
        },
        methods:{
          
            
        }
    })
</script>
</html>